﻿@model JPSOFTWARE.BON.Modelos.UsuarioEditarModel
@{
    ViewBag.Title = "BON - Editar Usuário";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.maskedinput-1.2.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/GestaoUsuario/editarUsuario.js")" type="text/javascript"></script>
<div class="page-header">
    <h1>
        Editar Usuário</h1>
</div>
<div class="row">
    <div style="width: auto" class="span1">
        <ul class="breadcrumb">
            <li>
                @Html.ActionLink("Registrar Usuario", "RegistrarUsuario")
            </li>
            <span class="divider">/</span>
            <li>
                @Html.ActionLink("Registrar Usuario", "RegistrarUsuario")
                <span class="divider">/</span> </li>
            <li class="active">
                @Html.ActionLink("Registrar Usuario", "RegistrarUsuario")
            </li>
        </ul>
    </div>
</div>
<div class="row">
    <div class="span7 offset3">
        <div class="form-horizontal well">
            @using (Html.BeginForm("EditarUsuario", "Usuario", FormMethod.Post))
            {     
                @Html.EditorFor(model => model.IdUsuario)
         

                @Html.Hidden("hEditarUsuario", ViewData["EditarUsuario"])
                @Html.Hidden("hUsuarioErro", ViewData["UsuarioErro"])
                @Html.Hidden("hMensagem", ViewData["Mensagem"])    

                @Html.ValidationSummary(true)

                <fieldset>
                    <legend>Os campos com "*" são de preenchimento obrigatório.</legend>
                    <div class="control-group">
                        <div class="control-label">
                            @Html.LabelFor(model => model.Nome)
                        </div>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.Nome, new { @class = "input-xlarge", MaxLength = 100 })
                            @Html.ValidationMessageFor(model => model.Nome)
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            @Html.LabelFor(model => model.Email)
                        </div>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.Email, new { @class = "input-xlarge", MaxLength = 100 })
                            @Html.ValidationMessageFor(model => model.Email)
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            @Html.LabelFor(model => model.Status)
                        </div>
                        <div class="controls">
                            @Html.CheckBoxFor(model => model.Status, new { @class = "input-xlarge" })
                            @Html.ValidationMessageFor(model => model.Status)
                        </div>
                    </div>
                    @*
                    <div class="control-group">
                        <div class="control-label">
                            @Html.LabelFor(model => model.Senha)
                        </div>
                        <div class="controls">
                            @Html.PasswordFor(model => model.Senha, new { @class = "input-xlarge", MaxLength = 100 })
                            @Html.ValidationMessageFor(model => model.Senha)
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="control-label">
                            @Html.LabelFor(model => model.ConfirmaSenha)
                        </div>
                        <div class="controls">
                            @Html.PasswordFor(model => model.ConfirmaSenha, new { @class = "input-xlarge", MaxLength = 8 })
                            @Html.ValidationMessageFor(model => model.ConfirmaSenha)
                        </div>
                    </div>

                    *@
                    <div class="form-actions">
                        <input type="submit" class="btn btn-primary btn-success" value="Salvar" />
                        @Html.ActionLink("Excluir", "ExcluirUsuario", "Usuario", new { Area = "GestaoUsuario", id = ViewBag.IdUsuario }, new { @class = "btn btn-danger btn-large" })
                        <input type="button" class="btn btn-large" id="btCancelar" value="Cancelar" />
                    </div>
                </fieldset>
            }
        </div>
    </div>
</div>
<div id="divEditarUsuarioSucesso" class="modal">
    <div class="modal-header">
        <h3>
            Editar Usuário</h3>
    </div>
    <div class="modal-body">
        @ViewData["Mensagem"]
    </div>
    <div class="modal-footer">
        @Html.ActionLink("Ok", "ListarUsuario", new { area = "GestaoUsuario" }, new { @class = "btn btn-primary" })
    </div>
</div>
<div id="divEditarUsuarioErro" class="modal">
    <div class="modal-header">
        <h3>
            Editar Usuário</h3>
    </div>
    <div class="modal-body">
        @ViewData["UsuarioErro"]
    </div>
    <div class="modal-footer">
        <span><a class="btn btn-primary" href="javascript:FecharTelaEditarUsuarioErro()">Tentar
            novamente?</a></span>
    </div>
</div>
<div id="divEditarUsuarioCancelar" class="modal">
    <div class="modal-header">
        <h3>
            Editar Usuário</h3>
    </div>
    <div class="modal-body">
        @JPSOFTWARE.BON.Modelos.Mensagens.MSG_020
    </div>
    <div class="modal-footer">
        <span><a class="btn btn-primary" href="javascript:CancelarOperacao()">Não</a></span>
        <span>@Html.ActionLink("Sim", "ListarUsuario", new { area = "GestaoUsuario" }, new { @class = "btn" })</span>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        FormularioEditarUsuario();
    });
</script>
